package com.example.demo;

import com.example.demo.Controller.BookController;
import com.example.demo.Dao.UserBook;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;


//Spring你就记住就是一个存对象，一个就是取对象用（在一个类中用另一个类的对象的时候我们就可以使用Spring的（Spring为你创建了这个类的对象了）依赖注入
@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
	 ApplicationContext context = SpringApplication.run(DemoApplication.class, args);
		BookController bookController = context.getBean(BookController.class);
		bookController.fun();
		/* UserBook userBook =(UserBook) context.getBean("userBook1");
		System.out.println(userBook);
		 */


	}

}
